package com.aos.erp.manager.remote.sys;

import com.aos.erp.common.bean.ResultBean;
import com.aos.erp.manager.remote.model.SynRole;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: erp
 * @description: 同步角色
 * @author: tanzhiyu
 * @create: 2018-11-22 19:54
 **/
@FeignClient(name = "${PERMISSION-SERVICE}"/*, url = "${PERMISSION-SERVICE-URL}"*/)
public interface SynRoleService {

    /**
     * 根据机构分页查询角色
     *
     * @param appCode
     * @param roleName
     * @param orgCode
     * @param page
     * @param limit
     * @return
     */
    @GetMapping(value = "/role/queryPageBy")
    ResultBean queryPageBy(@RequestParam("appCode") String appCode, @RequestParam("roleName") String roleName,
                           @RequestParam("orgCode") String orgCode, @RequestParam("page") Integer page,
                           @RequestParam("limit") Integer limit);

    /**
     * 根据用户名字查询角色信息
     *
     * @param username
     * @return
     */
    @GetMapping(value = "/role/getByUserName")
    ResultBean getByUserName(@RequestParam("username") String username);

    /**
     * 新增角色
     *
     * @param synRole
     * @return
     */
    @PostMapping(value = "/role/insert")
    ResultBean insert(@RequestBody SynRole synRole);
}
